import {real, showComponentToBody} from '@/utils';
import PageLoading from './index.vue';

let container: any = undefined;

export function startLoading() {
  if (container) return;
  container = real(showComponentToBody(PageLoading));
}

export function stopLoading() {
  if (!container) return;
  container.close();
  container = undefined;
}

export default {
  startLoading,
  stopLoading
}